﻿// *****************************************************************************
// **                   Ladenius MediaCenter TVSeries                         **
// ** ----------------------------------------------------------------------- **
// ** (c) 2008 by Jurjen Ladenius                                             **
// *****************************************************************************

#region Using directives
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ladenius.TheTVDB.Entities;
using Ladenius.TheTVDB.Dao;
#endregion

namespace Ladenius.TheTVDB.Business {

    /// <summary>
    /// Business logic for Episode
    /// </summary>
    internal static class EpisodeHome {

        /// <summary>
        /// Gets the episodes by series ID.
        /// </summary>
        /// <param name="seriesID">The series ID.</param>
        /// <param name="language">The language.</param>
        /// <returns>a list of episodes</returns>
        internal static List<Episode> GetBySeriesID (int seriesID, Language language) {
            return XMLRequester.GetEpisodesBySeriesID(seriesID, language);
        }

        /// <summary>
        /// Gets the episode by ID.
        /// </summary>
        /// <param name="id">The id.</param>
        /// <param name="language">The language.</param>
        /// <returns>an episode</returns>
        internal static Episode GetByID(int id, Language language) {
            return XMLRequester.GetEpisodeByID(id, language);
        }

        /// <summary>
        /// Gets the by series and season.
        /// </summary>
        /// <param name="seriesID">The series ID.</param>
        /// <param name="seasonNumber">The season number.</param>
        /// <param name="language">The language.</param>
        /// <returns>a list of episodes</returns>
        internal static List<Episode> GetBySeriesSeason(int seriesID, int seasonNumber, Language language) {
            return XMLRequester.GetEpisodesBySeriesID(seriesID, language).Where<Episode>(d => d.SeasonNumber == seasonNumber).ToList<Episode>();
        }

    }
}
